package offer;

public class offer_0055_1 {
    public int maxDepth(TreeNode root) {
        int[] max=new int[1];
        deepth(root,max,1);
        return max[0];
    }
    public void deepth(TreeNode node,int[] max,int deep){
        if(node==null) return;
        max[0]=Math.max(max[0],deep);
        deepth(node.left,max,deep+1);
        deepth(node.right,max,deep+1);
    }
}
